#ifndef __RECKON__VECTOR2_H__
#define __RECKON__VECTOR2_H__

#include "includes.h"

namespace reckon
{
	template <typename REAL>
	class Vector2
	{
		// ctor
	public:
		Vector2(REAL value)
			: e1(value)
			, e2(value)
		{
		}
		Vector2(REAL E1, REAL E2)
			: e1(E1)
			, e2(E2)
		{
		}
		Vector2(const Vector2<REAL>& other)
			: e1(other.e1)
			, e2(other.e2)
		{
		}
		Vector2(const REAL A[2])
			: e1(A[0])
			, e2(A[1])
		{
		}
		//operators
	public:
		Vector2<REAL>	operator-() const
		{
			return Vector2<REAL>(-e1, -e2);
		}

		Vector2<REAL>&	operator=(const Vector2<REAL>& other)
		{
			e1 = other.e1;
			e2 = other.e2;
			return *this;
		}
		Vector2<REAL>&	operator=(const REAL value)
		{
			e1 = value;
			e2 = value;
			return *this;
		}


		

		// data member
	public:
		union {
			REAL v[2]; 
			union
			{ 
				struct {REAL x;REAL y;};
				struct {REAL e1;REAL e2;};
			};
		};
	};
}

#endif // __RECKON__VECTOR2_H__